package Homework;

import java.io.File;
import java.io.IOException;
import java.util.Scanner;

public class t {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        System.out.println("输入文件名:");
        try{
            File file = new File("./"+scan.next());
            if(file.createNewFile())
                System.out.println("文件创建成功！");
            else
                System.out.println("出错了，该文件已经存在。");
            System.out.println("重来");
        }
        catch(IOException ioe) {
            ioe.printStackTrace();
        }
    }
    }

